package com.scorpio.basic.service.impl;

import java.util.Arrays;
import java.util.List;

import org.springframework.stereotype.Service;
import com.scorpio.basic.mapper.BannerMapper;
import com.scorpio.basic.domain.BannerEntity;
import com.scorpio.basic.service.IBannerService;
import com.scorpio.common.service.impl.BaseServiceImpl;
import org.springframework.transaction.annotation.Transactional;

/**
 * 首页bannerService业务层处理
 *
 * @author scorpio
 * @date 2021-10-29
 */
@Service
public class BannerServiceImpl extends BaseServiceImpl<BannerMapper, BannerEntity> implements IBannerService {

    //查询
    @Override
    public BannerEntity selectById(Long id) {
        return baseDao.selectById(id);
    }

    //查询列表
    @Override
    public List<BannerEntity> selectList(BannerEntity entity) {
        return baseDao.list(entity);
    }

    //新增$
    @Transactional(rollbackFor = Exception.class)
    @Override
    public int save(BannerEntity entity) {
        return baseDao.insert(entity);
    }

    //修改$
    @Transactional(rollbackFor = Exception.class)
    @Override
    public int update(BannerEntity entity) {
        return baseDao.updateById(entity);
    }

    //批量删除$
    @Transactional(rollbackFor = Exception.class)
    @Override
    public int deleteByIds(Long[] ids) {
        return baseDao.updateDelete(ids);
    }
}
